package org.example.framework;

import org.example.framework.protocol.dubbo.DubboProtocol;
import org.example.framework.protocol.http.HttpProtocol;

/**
 * @author shenguangyang
 */
public class ProtocolFactory {

    public static Protocol getProtocol(String name) {
        switch (name) {
            case "http":
                return new HttpProtocol();
            case "dubbo":
                return new DubboProtocol();
            default:
                throw new RuntimeException("not exist protocol");
        }
    }
}
